import {
  shallowEqual,
  TypedUseSelectorHook,
  useDispatch,
  useSelector
} from 'react-redux'
import store from '@/stores'
//获取store类型
type GetStateFnType = typeof store.getState
export type IRootState = ReturnType<GetStateFnType>
//useAppSelector/hook
export const useAppSelector: TypedUseSelectorHook<IRootState> = useSelector

//封装useDispatch
type DispatchType = typeof store.dispatch
export const useAppDispatch: () => DispatchType = useDispatch
export const shallowEqualApp = shallowEqual
